<nav aria-label="Page navigation" style="text-align: center">
    <ul class="pagination pagination-lg">
        <li {% if not pagination.has_prev %} class = 'disabled' {% endif %}>
                <a href="{% if pagination.has_prev %}{{ url_for('.index',page=pagination.page - 1) }}{% else %}#{% endif %}">
                 <span aria-hidden="true">&laquo;</span>
                </a>

        </li>
        {% for p in pagination.iter_pages() %}
             {% if p %}
                {% if p == pagination.page %}
                    <li class="active">
                        <a href="{{ url_for('.index',page = p) }}">{{ p }}</a>
                    </li>
                {% else %}
                <li>
                    <a href="{{ url_for('.index', page = p) }}">{{ p }}</a>
                </li>
                {% endif %}
            {% else %}
            <li class="disabled">
                <a href="#">&hellip;</a>
            </li>
            {% endif %}

        {% endfor %}


        <li {% if not pagination.has_next %} class = 'disabled' {% endif %}>
                <a href="{% if pagination.has_prev %}{{ url_for('.index',page=pagination.page + 1) }}{% else %}#{% endif %}">
                  <span aria-hidden="true">&raquo;</span>
                </a>

        </li>
    </ul>
</nav>